\section{Conclusion}
\label{subsec:conclude}

In this paper, we have presented a dynamic approach using Aspects to detect and
resolve deadlock and infinite loop. Deadlock and inifinite
loop caused system to come to a halt and makes debugging hard for programmers.
Deadlock is usually caused by multiple threads holding resources that the other
threads need to use. Infinite loop is a continual looping cycle of a program block.
This is often caused by unintentional programming error such as an error in
the conditional branch of the loop. 

We used a extended variant of AspectJ, Aspect Benchmark Compiler to help us
detect dynamically for deadlock and infinite loop in the program.  We used two
special pointcuts, lock() and unlock(). The two pointcuts are borrowed from an
extension (RacerAJ) of Aspect Benchmark Compiler. We also used the deadlock
detection algorithm for detecting deadlocks in a program. For detecting
infinite loop, we used call graph analysis to capture common method call
patterns to determine suspicion methods that are in an infinite loop within a
program. We evaluate our techniques by creating two test cases each having a
deadlock and infinite loop issue. Our evaluation showed that we can successfully
detect these two problems dynamically. 

We also reflect and anyalsed on the limitation of our approach. We discussed
some of them and described how we may further improve our approach in the
future. By implementing the various approach discussed, we will able to better
detect and resolve the deadlock and infinite loop issues. 
